package leecode

func maxPower(s string) int {
	var (
		result int
		temp   int
	)
	for i := 0; i+1 < len(s); i++ {
		if s[i:i+1] == s[i+1:i+2] {
			temp++
		} else {
			if temp > result {
				result = temp
			}
			temp = 0
		}
	}
	if temp > result {
		result = temp
	}
	return result + 1
}
